<template>
    <iframe id="template-iframe" ref="iframe" style="width: 100%; height: 100%; border: none" :style="{ height: divHeight }" :src="src"
            @load="loaded"></iframe>
</template>

<script>

export default {
    name: "dialogueProcess",
    data() {
        return {
            divHeight: 0,
            iframeWin: {},
            dialogueId: "",
        }
    },
    created() {
        let divHeight = document.body.clientHeight - 135 + "px";
        this.divHeight = divHeight;
        this.dialogueId = this.$route.params && this.$route.params.id;
    },
    methods: {
        loaded() {

        },
    },
    computed: {
        src() {
            var token = this.$store.getters.token;
            var host = "", address = "";
            if (process.env.NODE_ENV == "development" || process.env.NODE_ENV == "testing") {
                host = process.env.VUE_APP_BASE_API + ":608";
                address = "172.16.54.190:8085";
            } else {
                host = location.origin
                address = "172.16.71.64:81";
            }
            return "http://" + address + "/?#/index?dialogueId=" + this.dialogueId + "&token=" + token + "&host=" + host;
        },
    },
    components: {

    }
}
</script>

<style lang="scss">
</style>